﻿@using Jugg.Mapping.SysLog
@model Jugg.Admin.Framework.Datatable.DataSourceResult<Jugg.Entities.SysLog>
@{
    var arg = Model.SearchArg as Jugg.Mapping.SysLog.AdminSearchLogArg;
    ViewBag.Title = "系统日志列表";
}
<div class="breadcrumbs" id="breadcrumbs">
    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="@Url.RouteUrl("homeIndex")">首页</a>
        </li>
        <li class="active">@ViewBag.Title</li>
    </ul>
</div>
<div class="page-content">
    <div class="page-header">
        <h1>
            @ViewBag.Title
        </h1>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-body">
                    @using (Html.BeginRouteForm("sysLogIndex", new { }, FormMethod.Get, new { @class = "form-inline" }))
                    {

                    }
                </div>
            </div>
        </div>
    </div>
    @if (Model != null && Model.Data != null)
    {
        <div class="row">
            <div class="col-sm-12">
                <table id="user_datatable" class="table table-striped table-bordered table-hover dataTable no-footer">
                    <thead>
                        <tr>
                            <th width="50px">类型</th>
                            <th width="250px">错误</th>
                            <th width="100px">IP地址</th>
                            <th width="180px">连接</th>
                            <th width="160px">时间</th>
                            <th width=""></th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model.Data)
                        {
                            <tr>
                                <td>@(Enum.GetName(typeof(EnumLevel), item.Level))</td>
                                <td>@item.ShortMessage</td>
                                <td>@item.IpAddress</td>
                                <td>@item.PageUrl</td>
                                <td>@(item.CreationTime.ToString("yyyy-MM-dd HH;mm:ss"))</td>
                                <td>
                                    <!-- Large modal -->
                                    <button type="button" class="btn btn-link" data-toggle="modal" data-target="#Modal_@(item.Id)">查看</button>
                                    <div class="modal fade bs-example-modal-lg" id="Modal_@(item.Id)" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
                                        <div class="modal-dialog modal-lg" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
                                                    <h4 class="modal-title" id="myLargeModalLabel">错误详情</h4>
                                                </div>
                                                <div class="modal-body">
                                                    @item.FullMessage
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
                @Pagination(Model.Paging)
            </div>
        </div>
    }
</div>

